Avoid spurious notifications from GtkEntry
authorMatthias Clasen <mclasen@redhat.com>
Sat, 20 Mar 2010 03:20:38 +0000 (23:20 -0400)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Sun, 4 Apr 2010 00:59:17 +0000 (20:59 -0400)
Using gtk_entry_set_buffer() in dispose() causes problematic
notifications, so just get rid of the buffer manually. See bug 613241.

gtk/gtkentry.c

index 16b7f2a7cb4ab377a1834e857dae1cebee41971c..20653b4fca105b0793c294d35d21abb9b4b75997 100644 (file)
@@ -2463,12 +2463,19 @@ static void
 gtk_entry_dispose (GObject *object)
 {
   GtkEntry *entry = GTK_ENTRY (object);
+  GtkEntryPrivate *priv = GTK_ENTRY_GET_PRIVATE (entry);
 
   gtk_entry_set_icon_from_pixbuf (entry, GTK_ENTRY_ICON_PRIMARY, NULL);
   gtk_entry_set_icon_tooltip_markup (entry, GTK_ENTRY_ICON_PRIMARY, NULL);
   gtk_entry_set_icon_from_pixbuf (entry, GTK_ENTRY_ICON_SECONDARY, NULL);
   gtk_entry_set_icon_tooltip_markup (entry, GTK_ENTRY_ICON_SECONDARY, NULL);
-  gtk_entry_set_buffer (entry, NULL);
+
+  if (priv->buffer)
+    {
+      buffer_disconnect_signals (entry);
+      g_object_unref (priv->buffer);
+      priv->buffer = NULL;
+    }
 
   G_OBJECT_CLASS (gtk_entry_parent_class)->dispose (object);
 }